import Vue from 'vue';
import App from './App.vue';
import router from './router';
import { isAuthenticated, isAdmin } from './utils/auth';

Vue.config.productionTip = false;

let dynamicRoutes = [];

if (isAdmin()) {
  dynamicRoutes = [
    {
      path: '/activity-management',
      name: 'activity-management',
      component: () => import('./views/ActivityManagementView.vue')
    }
  ];
}

dynamicRoutes.forEach(route => {
  router.addRoute(route);
});

new Vue({
  router,
  render: h => h(App)
}).$mount('#app');